package cn.codeinn.service1.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.codeinn.common.annotations.Permission;
import cn.codeinn.common.enums.Scope;
import cn.codeinn.service1.entity.Member;
import cn.codeinn.service1.mapper.MemberMapper;
import cn.codeinn.service1.service.AuthService;

@Service("authService")
public class AuthServiceImpl implements AuthService {

	@Autowired
	private MemberMapper memberMapper;

	/**
	 * 1. type 对应dict_category表里的id ->表示过滤权限的种类
	 * 
	 * 2. scope user/system 针对用户权限/系统级权限 ----默认用户
	 * 
	 * 3. field 结果集中权限该字段过滤数据
	 * 
	 * 4. authName 缓存对象
	 * 
	 * 5. filter
	 */

	@Permission(type = "1", scope = Scope.USER, field = "id", authName = "authCache", filter = "")
	@Override
	public List<Member> testAuth() {
		return memberMapper.selectAll();
	}

}
